<?php

namespace pmvc\log;

/**
 * Logging utility class.
 */
class Log {

	public static function logMessage($level, $name, $message, $args=Array()) {
		Logger::getLogger($name)->log($level, $message, $args);
	}

	private static function doLog($level, $args) {
		$name 		= array_shift($args);
		$message	= array_shift($args);
		Log::logMessage($level, $name, $message, $args);
	}

	public static function trace() {
		Log::doLog(Logger::TRACE, func_get_args());
	}

	public static function fine() {
		Log::doLog(Logger::FINE, func_get_args());
	}

	public static function debug() {
		Log::doLog(Logger::DEBUG, func_get_args());
	}

	public static function info() {
		Log::doLog(Logger::INFO, func_get_args());
	}

	public static function warn() {
		Log::doLog(Logger::WARN, func_get_args());
	}

	public static function error() {
		Log::doLog(Logger::ERROR, func_get_args());
	}

	public static function fatal() {
		Log::doLog(Logger::FATAL, func_get_args());
	}

}

?>